{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "722743b2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple\n",
      "Collecting scikit-image==0.19.0\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/6e/16/4e6aa5877c86cd9a7f52ee148d2a857e1664a4752616ba1b2ec9ebfef43b/scikit_image-0.19.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (57.5 MB)\n",
      "\u001b[K     |████████████████████████████████| 57.5 MB 58.7 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: scipy>=1.4.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image==0.19.0) (1.5.4)\n",
      "Collecting networkx>=2.2\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/e9/93/aa6613aa70d6eb4868e667068b5a11feca9645498fd31b954b6c4bb82fa5/networkx-2.6.3-py3-none-any.whl (1.9 MB)\n",
      "\u001b[K     |████████████████████████████████| 1.9 MB 64.5 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: numpy>=1.17.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image==0.19.0) (1.17.5)\n",
      "Requirement already satisfied: packaging>=20.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image==0.19.0) (21.2)\n",
      "Collecting imageio>=2.4.1\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/e2/7f/eec12ebea34fcb37c7aba19131509ca89a8eda6e1dad05fc68d4473deed7/imageio-2.22.3-py3-none-any.whl (3.4 MB)\n",
      "\u001b[K     |████████████████████████████████| 3.4 MB 22.7 MB/s eta 0:00:01\n",
      "\u001b[?25hCollecting PyWavelets>=1.1.1\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/96/ee/f062fc1f2fbc99a38d1af52548b6ba3b0c88588c3de9ef120b5bf9f22270/PyWavelets-1.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.6 MB)\n",
      "\u001b[K     |████████████████████████████████| 6.6 MB 14.7 MB/s eta 0:00:01\n",
      "\u001b[?25hCollecting tifffile>=2019.7.26\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/d8/38/85ae5ed77598ca90558c17a2f79ddaba33173b31cf8d8f545d34d9134f0d/tifffile-2021.11.2-py3-none-any.whl (178 kB)\n",
      "\u001b[K     |████████████████████████████████| 178 kB 18.8 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image==0.19.0) (7.0.0)\n",
      "Collecting pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/b7/34/7a88f5ec5f26ac68d3d7a158c67c0a610a4e6b6d22c35266d0e715485b09/Pillow-9.3.0-cp37-cp37m-manylinux_2_28_aarch64.whl (3.1 MB)\n",
      "\u001b[K     |████████████████████████████████| 3.1 MB 56.7 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: pyparsing<3,>=2.0.2 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from packaging>=20.0->scikit-image==0.19.0) (2.4.7)\n",
      "Installing collected packages: pillow, tifffile, PyWavelets, networkx, imageio, scikit-image\n",
      "  Attempting uninstall: pillow\n",
      "    Found existing installation: Pillow 7.0.0\n",
      "    Uninstalling Pillow-7.0.0:\n",
      "      Successfully uninstalled Pillow-7.0.0\n",
      "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
      "modelarts 1.4.13 requires Pillow<=9.1.1, but you have pillow 9.3.0 which is incompatible.\n",
      "modelarts 1.4.13 requires psutil~=5.9.1, but you have psutil 5.7.0 which is incompatible.\n",
      "modelarts 1.4.13 requires requests~=2.28.1, but you have requests 2.23.0 which is incompatible.\n",
      "modelarts 1.4.13 requires urllib3~=1.26.11, but you have urllib3 1.26.7 which is incompatible.\n",
      "ma-cau 1.1.4 requires matplotlib==3.5.1, but you have matplotlib 3.1.2 which is incompatible.\n",
      "ma-cau 1.1.4 requires Pillow==9.1.1, but you have pillow 9.3.0 which is incompatible.\n",
      "ma-cau 1.1.4 requires pycocotools==2.0.3, but you have pycocotools 2.0.0 which is incompatible.\n",
      "ma-cau 1.1.4 requires terminaltables~=3.1.10, but you have terminaltables 3.1.0 which is incompatible.\n",
      "ipympl 0.9.1 requires ipywidgets<8,>=7.6.0, but you have ipywidgets 8.0.1 which is incompatible.\n",
      "ipympl 0.9.1 requires matplotlib<4,>=3.4.0, but you have matplotlib 3.1.2 which is incompatible.\u001b[0m\n",
      "Successfully installed PyWavelets-1.3.0 imageio-2.22.3 networkx-2.6.3 pillow-9.3.0 scikit-image-0.19.0 tifffile-2021.11.2\n",
      "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple\n",
      "Collecting SimpleITK==2.2.0\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cc/50/23b9a47f1098a58712340690e253c82b4f9248ac4b18d129ab639db21506/SimpleITK-2.2.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (48.1 MB)\n",
      "\u001b[K     |████████████████████████████████| 48.1 MB 4.3 MB/s eta 0:00:01    |███▎                            | 4.9 MB 3.6 MB/s eta 0:00:12     |███████████▉                    | 17.8 MB 3.6 MB/s eta 0:00:09     |███████████████████▎            | 29.0 MB 1.2 MB/s eta 0:00:16     |██████████████████████▋         | 33.9 MB 3.3 MB/s eta 0:00:05     |████████████████████████▎       | 36.6 MB 4.5 MB/s eta 0:00:03\n",
      "\u001b[?25hInstalling collected packages: SimpleITK\n",
      "Successfully installed SimpleITK-2.2.0\n",
      "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple\n",
      "Collecting dicom2nifti==1.0.0\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fe/77/5259d976889a7cc150823e9a8b75cce68af0ca6ddf18187f9b5b193634b0/dicom2nifti-1.0.0.tar.gz (22 kB)\n",
      "Collecting nibabel\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/89/51/c97641cc2cd1b3b14cdec54b4e86fe03fc59753ecd13dc67544716fb7353/nibabel-4.0.2-py3-none-any.whl (3.3 MB)\n",
      "\u001b[K     |████████████████████████████████| 3.3 MB 17.3 MB/s eta 0:00:01\n",
      "\u001b[?25hCollecting pydicom\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5f/45/97660cc1ec770e2e82fd5d704c1d6ff9c308ecfcbbf07c2b2f92ca755b70/pydicom-2.3.0-py3-none-any.whl (2.0 MB)\n",
      "\u001b[K     |████████████████████████████████| 2.0 MB 6.4 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: numpy in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from dicom2nifti==1.0.0) (1.17.5)\n",
      "Requirement already satisfied: six in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from dicom2nifti==1.0.0) (1.16.0)\n",
      "Requirement already satisfied: future in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from dicom2nifti==1.0.0) (0.18.2.post20200723173923)\n",
      "Requirement already satisfied: setuptools in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from nibabel->dicom2nifti==1.0.0) (58.0.4)\n",
      "Requirement already satisfied: packaging>=17.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from nibabel->dicom2nifti==1.0.0) (21.2)\n",
      "Requirement already satisfied: pyparsing<3,>=2.0.2 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from packaging>=17.0->nibabel->dicom2nifti==1.0.0) (2.4.7)\n",
      "Building wheels for collected packages: dicom2nifti\n",
      "  Building wheel for dicom2nifti (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for dicom2nifti: filename=dicom2nifti-1.0.0-py3-none-any.whl size=31026 sha256=8ca1c33db48519f98216c11800abde95d72faf9ec7426ab8ecad03a9c58b1dba\n",
      "  Stored in directory: /home/ma-user/.cache/pip/wheels/8c/31/c3/f8a085cb16421cf3563565e94cfd94d4d638ce97e5e7f799b4\n",
      "Successfully built dicom2nifti\n",
      "Installing collected packages: pydicom, nibabel, dicom2nifti\n",
      "Successfully installed dicom2nifti-1.0.0 nibabel-4.0.2 pydicom-2.3.0\n",
      "Looking in indexes: http://repo.myhuaweicloud.com/repository/pypi/simple\n",
      "Requirement already satisfied: tqdm in /home/ma-user/modelarts/modelarts-sdk (from -r requirements.txt (line 1)) (4.63.1)\n",
      "Requirement already satisfied: dicom2nifti in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (1.0.0)\n",
      "Requirement already satisfied: scikit-image>=0.14 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (0.19.0)\n",
      "Collecting medpy\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/3b/70/c1fd5dd60242eee81774696ea7ba4caafac2bad8f028bba94b1af83777d7/MedPy-0.4.0.tar.gz (151 kB)\n",
      "\u001b[K     |████████████████████████████████| 151 kB 23.0 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: scipy in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (1.5.4)\n",
      "Collecting batchgenerators>=0.23\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/38/9b/ff5310c6545fca92c76aa18407d554f840533820e0a3715977376b51c871/batchgenerators-0.24.tar.gz (61 kB)\n",
      "\u001b[K     |████████████████████████████████| 61 kB 7.3 MB/s  eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: numpy in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 7)) (1.17.5)\n",
      "Collecting sklearn\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/1e/7a/dbb3be0ce9bd5c8b7e3d87328e79063f8b263b2b1bfa4774cb1147bfcd3f/sklearn-0.0.tar.gz (1.1 kB)\n",
      "Requirement already satisfied: SimpleITK in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 9)) (2.2.0)\n",
      "Requirement already satisfied: pandas in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 10)) (1.1.3)\n",
      "Requirement already satisfied: requests in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 11)) (2.23.0)\n",
      "Requirement already satisfied: nibabel in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 12)) (4.0.2)\n",
      "Requirement already satisfied: tifffile in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from -r requirements.txt (line 13)) (2021.11.2)\n",
      "Requirement already satisfied: six in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from dicom2nifti->-r requirements.txt (line 2)) (1.16.0)\n",
      "Requirement already satisfied: pydicom in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from dicom2nifti->-r requirements.txt (line 2)) (2.3.0)\n",
      "Requirement already satisfied: future in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from dicom2nifti->-r requirements.txt (line 2)) (0.18.2.post20200723173923)\n",
      "Requirement already satisfied: networkx>=2.2 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image>=0.14->-r requirements.txt (line 3)) (2.6.3)\n",
      "Requirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image>=0.14->-r requirements.txt (line 3)) (9.3.0)\n",
      "Requirement already satisfied: packaging>=20.0 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image>=0.14->-r requirements.txt (line 3)) (21.2)\n",
      "Requirement already satisfied: imageio>=2.4.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image>=0.14->-r requirements.txt (line 3)) (2.22.3)\n",
      "Requirement already satisfied: PyWavelets>=1.1.1 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-image>=0.14->-r requirements.txt (line 3)) (1.3.0)\n",
      "Requirement already satisfied: scikit-learn in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from batchgenerators>=0.23->-r requirements.txt (line 6)) (0.24.0)\n",
      "Collecting unittest2\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/72/20/7f0f433060a962200b7272b8c12ba90ef5b903e218174301d0abfd523813/unittest2-1.1.0-py2.py3-none-any.whl (96 kB)\n",
      "\u001b[K     |████████████████████████████████| 96 kB 20.5 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: threadpoolctl in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from batchgenerators>=0.23->-r requirements.txt (line 6)) (3.0.0)\n",
      "Requirement already satisfied: pytz>=2017.2 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from pandas->-r requirements.txt (line 10)) (2021.3)\n",
      "Requirement already satisfied: python-dateutil>=2.7.3 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from pandas->-r requirements.txt (line 10)) (2.8.2)\n",
      "Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/56/aa/4ef5aa67a9a62505db124a5cb5262332d1d4153462eb8fd89c9fa41e5d92/urllib3-1.25.11-py2.py3-none-any.whl (127 kB)\n",
      "\u001b[K     |████████████████████████████████| 127 kB 7.3 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: certifi>=2017.4.17 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from requests->-r requirements.txt (line 11)) (2021.10.8)\n",
      "Requirement already satisfied: idna<3,>=2.5 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from requests->-r requirements.txt (line 11)) (2.10)\n",
      "Requirement already satisfied: chardet<4,>=3.0.2 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from requests->-r requirements.txt (line 11)) (3.0.4)\n",
      "Requirement already satisfied: setuptools in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from nibabel->-r requirements.txt (line 12)) (58.0.4)\n",
      "Requirement already satisfied: pyparsing<3,>=2.0.2 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from packaging>=20.0->scikit-image>=0.14->-r requirements.txt (line 3)) (2.4.7)\n",
      "Requirement already satisfied: joblib>=0.11 in /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages (from scikit-learn->batchgenerators>=0.23->-r requirements.txt (line 6)) (1.1.0)\n",
      "Collecting traceback2\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/17/0a/6ac05a3723017a967193456a2efa0aa9ac4b51456891af1e2353bb9de21e/traceback2-1.4.0-py2.py3-none-any.whl (16 kB)\n",
      "Collecting argparse\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl (23 kB)\n",
      "Collecting linecache2\n",
      "  Downloading http://repo.myhuaweicloud.com/repository/pypi/packages/c7/a3/c5da2a44c85bfbb6eebcfc1dde24933f8704441b98fdde6528f4831757a6/linecache2-1.0.0-py2.py3-none-any.whl (12 kB)\n",
      "Building wheels for collected packages: medpy, batchgenerators, sklearn\n",
      "  Building wheel for medpy (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for medpy: filename=MedPy-0.4.0-py3-none-any.whl size=214963 sha256=1142838a33578660c354d28c07f9e515823eeecc79b82f8f08b32e2a73b010f4\n",
      "  Stored in directory: /home/ma-user/.cache/pip/wheels/5a/10/fe/344b74ce0ce6e783dc3f8db3bcf5fb338491e6e9fb2b8fbfa6\n",
      "  Building wheel for batchgenerators (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for batchgenerators: filename=batchgenerators-0.24-py3-none-any.whl size=89208 sha256=8fd2fa1aafbd296208cf829d5f634eedb33c34087fe81b68d87b3df5393f1ded\n",
      "  Stored in directory: /home/ma-user/.cache/pip/wheels/7f/36/fe/bdef60fa0a7a4d66ec48390eb1b7f34ec3f672389b20a7783e\n",
      "  Building wheel for sklearn (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for sklearn: filename=sklearn-0.0-py2.py3-none-any.whl size=1309 sha256=327358da522316f3e2a2a043730d5fb3fdc52d4b0afd164bd8939fdd9f418806\n",
      "  Stored in directory: /home/ma-user/.cache/pip/wheels/b0/69/f8/40753cb55d87271aa8cb7ab62d083aa08a6d4de64c4bdf6cb7\n",
      "Successfully built medpy batchgenerators sklearn\n",
      "Installing collected packages: linecache2, traceback2, argparse, urllib3, unittest2, sklearn, medpy, batchgenerators\n",
      "  Attempting uninstall: urllib3\n",
      "    Found existing installation: urllib3 1.26.7\n",
      "    Uninstalling urllib3-1.26.7:\n",
      "      Successfully uninstalled urllib3-1.26.7\n",
      "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
      "moxing-framework 2.0.0.rc2.4b57a67b requires urllib3>=1.26.2, but you have urllib3 1.25.11 which is incompatible.\n",
      "modelarts 1.4.13 requires Pillow<=9.1.1, but you have pillow 9.3.0 which is incompatible.\n",
      "modelarts 1.4.13 requires psutil~=5.9.1, but you have psutil 5.7.0 which is incompatible.\n",
      "modelarts 1.4.13 requires requests~=2.28.1, but you have requests 2.23.0 which is incompatible.\n",
      "modelarts 1.4.13 requires urllib3~=1.26.11, but you have urllib3 1.25.11 which is incompatible.\n",
      "ma-cau 1.1.4 requires matplotlib==3.5.1, but you have matplotlib 3.1.2 which is incompatible.\n",
      "ma-cau 1.1.4 requires Pillow==9.1.1, but you have pillow 9.3.0 which is incompatible.\n",
      "ma-cau 1.1.4 requires pycocotools==2.0.3, but you have pycocotools 2.0.0 which is incompatible.\n",
      "ma-cau 1.1.4 requires terminaltables~=3.1.10, but you have terminaltables 3.1.0 which is incompatible.\u001b[0m\n",
      "Successfully installed argparse-1.4.0 batchgenerators-0.24 linecache2-1.0.0 medpy-0.4.0 sklearn-0.0 traceback2-1.4.0 unittest2-1.1.0 urllib3-1.25.11\n"
     ]
    }
   ],
   "source": [
    "# 安装库依赖\n",
    "!pip install scikit-image==0.19.0\n",
    "!pip install SimpleITK==2.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple\n",
    "!pip install dicom2nifti==1.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple\n",
    "!pip install -r requirements.txt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f986dd76",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 转换数据集\n",
    "!python src/nnunet/experiment_planning/nnUNet_convert_decathlon_task.py -r ./kits19 -i ./src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task01_kits"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b42c347d",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据预处理\n",
    "!python ./src/nnunet/experiment_planning/nnUNet_plan_and_preprocess.py -t 1  -tl 4 -tf 4 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "37d4ad3b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 训练模型\n",
    "!python train.py 3d_fullres nnUNetTrainerV2_SGD 1 all"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b13b6c7a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 产生验证集\n",
    "!python src/nnunet/generate_testset.py --splits_final=src/nnUNetFrame/DATASET/nnUNet_preprocessed/Task001_kits/splits_final.pkl --fold=0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "63fc6683",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 生成验证集预测\n",
    "!python eval.py -i src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/imagesVal/ -o src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferVal -t 1 -m 3d_fullres -tr nnUNetTrainerV2_SGD -f all --final_submit=False "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1e440e73",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 生成验证集评价指标\n",
    "!python src/nnunet/evaluation/evaluator.py -ref src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/labelsVal  -pred src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferVal -l 0 1 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dad0c015",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "Please cite the following paper when using nnUNet:\n",
      "\n",
      "Isensee, F., Jaeger, P.F., Kohl, S.A.A. et al. \"nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation.\" Nat Methods (2020).\n",
      "If you have questions or suggestions, feel free to open an issue at github nnunet\n",
      "\n",
      "using model stored in  ./src/nnUNetFrame/DATASET/nnUNet_trained_models/nnUNet/3d_fullres/Task001_kits/nnUNetTrainerV2_SGD__nnUNetPlansv2.1\n",
      "args.chk model_best\n",
      "This model expects 1 input modalities for each image\n",
      "Found 90 unique case ids, here are some examples: ['kits_case_00210' 'kits_case_00269' 'kits_case_00215' 'kits_case_00212'\n",
      " 'kits_case_00252' 'kits_case_00298' 'kits_case_00228' 'kits_case_00218'\n",
      " 'kits_case_00260' 'kits_case_00269']\n",
      "If they don't look right, make sure to double check your filenames. They must end with _0000.nii.gz etc\n",
      "number of cases: 90\n",
      "number of cases that still need to be predicted: 90\n",
      "loading parameters for folds, ['all']\n",
      "deterministic out\n",
      "model_best.ckpt.pkl\n",
      "weight_factors  [0.53333333 0.26666667 0.13333333 0.06666667 0.        ]\n",
      "upscale_logits False\n",
      "using the following model files:  ['./src/nnUNetFrame/DATASET/nnUNet_trained_models/nnUNet/3d_fullres/Task001_kits/nnUNetTrainerV2_SGD__nnUNetPlansv2.1/all/model_best.ckpt']\n",
      "starting preprocessing generator\n",
      "starting prediction...\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00210.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00211.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00212.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00213.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00214.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00215.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00216.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00217.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "before crop: (1, 512, 512, 42) after crop: (1, 512, 512, 42) spacing: [0.8671875 0.8671875 5.       ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 82) after crop: (1, 512, 512, 82) spacing: [0.9375 0.9375 3.75  ] \n",
      "\n",
      "before crop: (1, 512, 512, 87) after crop: (1, 512, 512, 87) spacing: [0.7421875 0.7421875 3.       ] \n",
      "\n",
      "before crop: (1, 512, 512, 95) after crop: (1, 512, 512, 95) spacing: [0.86132812 0.86132812 3.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "before: {'spacing': array([0.8671875, 0.8671875, 5.       ]), 'spacing_transposed': array([5.       , 0.8671875, 0.8671875]), 'data.shape (data is transposed)': (1, 42, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 65, 274, 274)} \n",
      "\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00218.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00210.nii.gz\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 274, 274)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 57, 114], [0, 57, 114]]\n",
      "number of tiles: 9\n",
      "computing Gaussian\n",
      "before crop: (1, 512, 512, 139) after crop: (1, 512, 512, 139) spacing: [0.79296875 0.79296875 3.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.7421875, 0.7421875, 3.       ]), 'spacing_transposed': array([3.       , 0.7421875, 0.7421875]), 'data.shape (data is transposed)': (1, 87, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 81, 235, 235)} \n",
      "\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00220.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "before: {'spacing': array([0.9375, 0.9375, 3.75  ]), 'spacing_transposed': array([3.75  , 0.9375, 0.9375]), 'data.shape (data is transposed)': (1, 82, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 95, 296, 296)} \n",
      "\n",
      "before crop: (1, 512, 512, 164) after crop: (1, 512, 512, 164) spacing: [0.859375 0.859375 3.      ] \n",
      "\n",
      "before: {'spacing': array([0.86132812, 0.86132812, 3.        ]), 'spacing_transposed': array([3.        , 0.86132812, 0.86132812]), 'data.shape (data is transposed)': (1, 95, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 89, 272, 272)} \n",
      "\n",
      "before: {'spacing': array([0.79296875, 0.79296875, 3.        ]), 'spacing_transposed': array([3.        , 0.79296875, 0.79296875]), 'data.shape (data is transposed)': (1, 139, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 130, 251, 251)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "[WARNING] SESSION(185065,ffff137fe1e0,python):2022-11-06-12:08:30.902.054 [mindspore/ccsrc/backend/session/ascend_session.cc:1806] SelectKernel] There are 32 node/nodes used reduce precision to selected the kernel!\n",
      "before crop: (1, 512, 512, 174) after crop: (1, 512, 512, 174) spacing: [0.78125 0.78125 3.     ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "before: {'spacing': array([0.859375, 0.859375, 3.      ]), 'spacing_transposed': array([3.      , 0.859375, 0.859375]), 'data.shape (data is transposed)': (1, 164, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 153, 272, 272)} \n",
      "\n",
      "before crop: (1, 512, 512, 505) after crop: (1, 512, 512, 505) spacing: [0.953125 0.953125 1.      ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 743) after crop: (1, 512, 512, 743) spacing: [0.82421875 0.82421875 0.5       ] \n",
      "\n",
      "no separate z, order 3\n",
      "before: {'spacing': array([0.78125, 0.78125, 3.     ]), 'spacing_transposed': array([3.     , 0.78125, 0.78125]), 'data.shape (data is transposed)': (1, 174, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 162, 247, 247)} \n",
      "\n",
      "before crop: (1, 512, 512, 636) after crop: (1, 512, 512, 636) spacing: [0.7734375 0.7734375 1.       ] \n",
      "\n",
      "no separate z, order 3\n",
      "[WARNING] DEVICE(185065,ffff137fe1e0,python):2022-11-06-12:09:04.640.965 [mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc:284] TagRaiseReduce] Node:[Tile] reduce precision from int64 to int32\n",
      "[WARNING] SESSION(185065,ffff137fe1e0,python):2022-11-06-12:09:04.641.055 [mindspore/ccsrc/backend/session/ascend_session.cc:1205] SelectKernel] There has 1 node/nodes used reduce precision to selected the kernel!\n",
      "[WARNING] DEVICE(185065,ffff137fe1e0,python):2022-11-06-12:09:04.700.523 [mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc:284] TagRaiseReduce] Node:[ScatterNdUpdate] reduce precision from int64 to int32\n",
      "[WARNING] DEVICE(185065,ffff137fe1e0,python):2022-11-06-12:09:04.700.567 [mindspore/ccsrc/runtime/device/ascend/kernel_select_ascend.cc:284] TagRaiseReduce] Node:[ScatterNdUpdate] reduce precision from int64 to int32\n",
      "[WARNING] SESSION(185065,ffff137fe1e0,python):2022-11-06-12:09:04.700.696 [mindspore/ccsrc/backend/session/ascend_session.cc:1205] SelectKernel] There has 1 node/nodes used reduce precision to selected the kernel!\n",
      "[WARNING] PRE_ACT(185065,ffff137fe1e0,python):2022-11-06-12:09:04.701.842 [mindspore/ccsrc/backend/optimizer/ascend/format_type/deal_ref_and_split_unsupported_transdata.cc:110] AddAdditionalToRefOutput] ref op origin node is not parameter\n",
      "no separate z, order 3\n",
      "no separate z, order 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (65, 274, 274)\n",
      "class_probabilities.shape (3, 65, 274, 274)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00223.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00212.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "data shape: (1, 96, 235, 235)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 75], [0, 75]]\n",
      "number of tiles: 4\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "no separate z, order 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (81, 235, 235)\n",
      "class_probabilities.shape (3, 81, 235, 235)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00219.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00215.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 296, 296)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 68, 136], [0, 68, 136]]\n",
      "number of tiles: 9\n",
      "using precomputed Gaussian\n",
      "prediction done\n",
      "predicted_segmentation.shape (95, 296, 296)\n",
      "class_probabilities.shape (3, 95, 296, 296)\n",
      "no separate z, order 1\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00225.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00211.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 272, 272)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 56, 112], [0, 56, 112]]\n",
      "number of tiles: 9\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 167) after crop: (1, 512, 512, 167) spacing: [0.85546875 0.85546875 3.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "before crop: (1, 512, 512, 103) after crop: (1, 512, 512, 103) spacing: [0.80078125 0.80078125 5.        ] \n",
      "\n",
      "before: {'spacing': array([0.953125, 0.953125, 1.      ]), 'spacing_transposed': array([1.      , 0.953125, 0.953125]), 'data.shape (data is transposed)': (1, 505, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 157, 301, 301)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (89, 272, 272)\n",
      "class_probabilities.shape (3, 89, 272, 272)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00226.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00217.nii.gz\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 130, 251, 251)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 34], [0, 46, 91], [0, 46, 91]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 479) after crop: (1, 512, 512, 479) spacing: [0.94921875 0.94921875 3.        ] \n",
      "\n",
      "before: {'spacing': array([0.80078125, 0.80078125, 5.        ]), 'spacing_transposed': array([5.        , 0.80078125, 0.80078125]), 'data.shape (data is transposed)': (1, 103, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 160, 253, 253)} \n",
      "\n",
      "before: {'spacing': array([0.85546875, 0.85546875, 3.        ]), 'spacing_transposed': array([3.        , 0.85546875, 0.85546875]), 'data.shape (data is transposed)': (1, 167, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 156, 270, 270)} \n",
      "\n",
      "before crop: (1, 512, 512, 160) after crop: (1, 512, 512, 160) spacing: [0.9375 0.9375 3.    ] \n",
      "\n",
      "before: {'spacing': array([0.82421875, 0.82421875, 0.5       ]), 'spacing_transposed': array([0.5       , 0.82421875, 0.82421875]), 'data.shape (data is transposed)': (1, 743, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 115, 260, 260)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (130, 251, 251)\n",
      "class_probabilities.shape (3, 130, 251, 251)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00228.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00218.nii.gz\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 153, 272, 272)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 28, 57], [0, 56, 112], [0, 56, 112]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 102) after crop: (1, 512, 512, 102) spacing: [0.741 0.741 5.   ] \n",
      "\n",
      "before: {'spacing': array([0.7734375, 0.7734375, 1.       ]), 'spacing_transposed': array([1.       , 0.7734375, 0.7734375]), 'data.shape (data is transposed)': (1, 636, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 198, 244, 244)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "before: {'spacing': array([0.9375, 0.9375, 3.    ]), 'spacing_transposed': array([3.    , 0.9375, 0.9375]), 'data.shape (data is transposed)': (1, 160, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 149, 296, 296)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.741, 0.741, 5.   ]), 'spacing_transposed': array([5.   , 0.741, 0.741]), 'data.shape (data is transposed)': (1, 102, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 158, 234, 234)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (153, 272, 272)\n",
      "class_probabilities.shape (3, 153, 272, 272)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00222.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00220.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 162, 247, 247)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 33, 66], [0, 44, 87], [0, 44, 87]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 91) after crop: (1, 512, 512, 91) spacing: [0.7421875 0.7421875 5.       ] \n",
      "\n",
      "before: {'spacing': array([0.94921875, 0.94921875, 3.        ]), 'spacing_transposed': array([3.        , 0.94921875, 0.94921875]), 'data.shape (data is transposed)': (1, 479, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 446, 300, 300)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.7421875, 0.7421875, 5.       ]), 'spacing_transposed': array([5.       , 0.7421875, 0.7421875]), 'data.shape (data is transposed)': (1, 91, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 141, 235, 235)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (162, 247, 247)\n",
      "class_probabilities.shape (3, 162, 247, 247)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00233.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00214.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 157, 301, 301)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 30, 61], [0, 70, 141], [0, 70, 141]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 96) after crop: (1, 512, 512, 96) spacing: [0.741 0.741 5.   ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.741, 0.741, 5.   ]), 'spacing_transposed': array([5.   , 0.741, 0.741]), 'data.shape (data is transposed)': (1, 96, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 149, 234, 234)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (157, 301, 301)\n",
      "class_probabilities.shape (3, 157, 301, 301)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00227.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00225.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 160, 253, 253)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 32, 64], [0, 46, 93], [0, 46, 93]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "before crop: (1, 512, 512, 145) after crop: (1, 512, 512, 145) spacing: [0.86914062 0.86914062 3.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.86914062, 0.86914062, 3.        ]), 'spacing_transposed': array([3.        , 0.86914062, 0.86914062]), 'data.shape (data is transposed)': (1, 145, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 135, 275, 275)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (160, 253, 253)\n",
      "class_probabilities.shape (3, 160, 253, 253)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00224.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00219.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 156, 270, 270)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 30, 60], [0, 55, 110], [0, 55, 110]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 97) after crop: (1, 512, 512, 97) spacing: [0.86132812 0.86132812 5.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.86132812, 0.86132812, 5.        ]), 'spacing_transposed': array([5.        , 0.86132812, 0.86132812]), 'data.shape (data is transposed)': (1, 97, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 151, 272, 272)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (156, 270, 270)\n",
      "class_probabilities.shape (3, 156, 270, 270)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00221.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00216.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 115, 260, 260)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 19], [0, 50, 100], [0, 50, 100]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 141) after crop: (1, 512, 512, 141) spacing: [0.75585938 0.75585938 5.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (115, 260, 260)\n",
      "class_probabilities.shape (3, 115, 260, 260)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00234.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00213.nii.gz\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 198, 244, 244)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 34, 68, 102], [0, 42, 84], [0, 42, 84]]\n",
      "number of tiles: 36\n",
      "using precomputed Gaussian\n",
      "before: {'spacing': array([0.75585938, 0.75585938, 5.        ]), 'spacing_transposed': array([5.        , 0.75585938, 0.75585938]), 'data.shape (data is transposed)': (1, 141, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 219, 239, 239)} \n",
      "\n",
      "before crop: (1, 512, 512, 140) after crop: (1, 512, 512, 140) spacing: [0.68554688 0.68554688 3.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.68554688, 0.68554688, 3.        ]), 'spacing_transposed': array([3.        , 0.68554688, 0.68554688]), 'data.shape (data is transposed)': (1, 140, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 130, 217, 217)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (198, 244, 244)\n",
      "class_probabilities.shape (3, 198, 244, 244)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00236.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00226.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 149, 296, 296)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 26, 53], [0, 68, 136], [0, 68, 136]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "before crop: (1, 512, 512, 64) after crop: (1, 512, 512, 64) spacing: [0.921875 0.921875 5.      ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.921875, 0.921875, 5.      ]), 'spacing_transposed': array([5.      , 0.921875, 0.921875]), 'data.shape (data is transposed)': (1, 64, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 99, 291, 291)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (149, 296, 296)\n",
      "class_probabilities.shape (3, 149, 296, 296)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00231.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00228.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 158, 234, 234)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 31, 62], [0, 74], [0, 74]]\n",
      "number of tiles: 12\n",
      "using precomputed Gaussian\n",
      "before crop: (1, 512, 512, 165) after crop: (1, 512, 512, 165) spacing: [0.921875 0.921875 3.      ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (158, 234, 234)\n",
      "class_probabilities.shape (3, 158, 234, 234)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00230.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00223.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 446, 300, 300)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 44, 88, 131, 175, 219, 262, 306, 350], [0, 70, 140], [0, 70, 140]]\n",
      "number of tiles: 81\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 93) after crop: (1, 512, 512, 93) spacing: [0.64453125 0.64453125 5.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.921875, 0.921875, 3.      ]), 'spacing_transposed': array([3.      , 0.921875, 0.921875]), 'data.shape (data is transposed)': (1, 165, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 154, 291, 291)} \n",
      "\n",
      "before: {'spacing': array([0.64453125, 0.64453125, 5.        ]), 'spacing_transposed': array([5.        , 0.64453125, 0.64453125]), 'data.shape (data is transposed)': (1, 93, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 144, 204, 204)} \n",
      "\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (446, 300, 300)\n",
      "class_probabilities.shape (3, 446, 300, 300)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00241.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00222.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 141, 235, 235)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 45], [0, 75], [0, 75]]\n",
      "number of tiles: 8\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 99) after crop: (1, 512, 512, 99) spacing: [0.82617188 0.82617188 5.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (141, 235, 235)\n",
      "class_probabilities.shape (3, 141, 235, 235)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00235.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00233.nii.gz\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 149, 234, 234)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 26, 53], [0, 74], [0, 74]]\n",
      "number of tiles: 12\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.82617188, 0.82617188, 5.        ]), 'spacing_transposed': array([5.        , 0.82617188, 0.82617188]), 'data.shape (data is transposed)': (1, 99, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 154, 261, 261)} \n",
      "\n",
      "before crop: (1, 512, 512, 159) after crop: (1, 512, 512, 159) spacing: [0.78125 0.78125 3.     ] \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (149, 234, 234)\n",
      "class_probabilities.shape (3, 149, 234, 234)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00232.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00227.nii.gz\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 135, 275, 275)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 39], [0, 58, 115], [0, 58, 115]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 101) after crop: (1, 512, 512, 101) spacing: [0.8203125 0.8203125 5.       ] \n",
      "\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.78125, 0.78125, 3.     ]), 'spacing_transposed': array([3.     , 0.78125, 0.78125]), 'data.shape (data is transposed)': (1, 159, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 148, 247, 247)} \n",
      "\n",
      "before: {'spacing': array([0.8203125, 0.8203125, 5.       ]), 'spacing_transposed': array([5.       , 0.8203125, 0.8203125]), 'data.shape (data is transposed)': (1, 101, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 157, 259, 259)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (135, 275, 275)\n",
      "class_probabilities.shape (3, 135, 275, 275)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00229.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00224.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 151, 272, 272)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 28, 55], [0, 56, 112], [0, 56, 112]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 266) after crop: (1, 512, 512, 266) spacing: [0.76171875 0.76171875 1.        ] \n",
      "\n",
      "no separate z, order 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (151, 272, 272)\n",
      "class_probabilities.shape (3, 151, 272, 272)\n",
      "no separate z, order 1\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00242.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00221.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 219, 239, 239)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 41, 82, 123], [0, 79], [0, 79]]\n",
      "number of tiles: 16\n",
      "using precomputed Gaussian\n",
      "before crop: (1, 512, 512, 82) after crop: (1, 512, 512, 82) spacing: [0.76171875 0.76171875 5.        ] \n",
      "\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.76171875, 0.76171875, 1.        ]), 'spacing_transposed': array([1.        , 0.76171875, 0.76171875]), 'data.shape (data is transposed)': (1, 266, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 83, 241, 241)} \n",
      "\n",
      "before: {'spacing': array([0.76171875, 0.76171875, 5.        ]), 'spacing_transposed': array([5.        , 0.76171875, 0.76171875]), 'data.shape (data is transposed)': (1, 82, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 127, 241, 241)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (219, 239, 239)\n",
      "class_probabilities.shape (3, 219, 239, 239)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00244.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00234.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 130, 217, 217)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 34], [0, 57], [0, 57]]\n",
      "number of tiles: 8\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 88) after crop: (1, 512, 512, 88) spacing: [0.703125 0.703125 2.      ] \n",
      "\n",
      "no separate z, order 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (130, 217, 217)\n",
      "class_probabilities.shape (3, 130, 217, 217)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00239.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00236.nii.gz\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 99, 291, 291)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 3], [0, 66, 131], [0, 66, 131]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "no separate z, order 1\n",
      "before crop: (1, 512, 512, 92) after crop: (1, 512, 512, 92) spacing: [0.8203125 0.8203125 5.       ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "before: {'spacing': array([0.703125, 0.703125, 2.      ]), 'spacing_transposed': array([2.      , 0.703125, 0.703125]), 'data.shape (data is transposed)': (1, 88, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 55, 222, 222)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.8203125, 0.8203125, 5.       ]), 'spacing_transposed': array([5.       , 0.8203125, 0.8203125]), 'data.shape (data is transposed)': (1, 92, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 143, 259, 259)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (99, 291, 291)\n",
      "class_probabilities.shape (3, 99, 291, 291)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00238.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00231.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 154, 291, 291)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 29, 58], [0, 66, 131], [0, 66, 131]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 96) after crop: (1, 512, 512, 96) spacing: [0.80078125 0.80078125 5.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.80078125, 0.80078125, 5.        ]), 'spacing_transposed': array([5.        , 0.80078125, 0.80078125]), 'data.shape (data is transposed)': (1, 96, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 149, 253, 253)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (154, 291, 291)\n",
      "class_probabilities.shape (3, 154, 291, 291)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00249.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00230.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 144, 204, 204)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 48], [0, 44], [0, 44]]\n",
      "number of tiles: 8\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (144, 204, 204)\n",
      "class_probabilities.shape (3, 144, 204, 204)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00243.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00241.nii.gz\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 154, 261, 261)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 29, 58], [0, 50, 101], [0, 50, 101]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "before crop: (1, 512, 512, 92) after crop: (1, 512, 512, 92) spacing: [0.87304688 0.87304688 5.        ] \n",
      "\n",
      "before crop: (1, 512, 512, 258) after crop: (1, 512, 512, 258) spacing: [0.78515625 0.78515625 1.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "no separate z, order 3\n",
      "before: {'spacing': array([0.87304688, 0.87304688, 5.        ]), 'spacing_transposed': array([5.        , 0.87304688, 0.87304688]), 'data.shape (data is transposed)': (1, 92, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 143, 276, 276)} \n",
      "\n",
      "no separate z, order 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (154, 261, 261)\n",
      "class_probabilities.shape (3, 154, 261, 261)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00240.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00235.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 148, 247, 247)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 26, 52], [0, 44, 87], [0, 44, 87]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 193) after crop: (1, 512, 512, 193) spacing: [0.703125 0.703125 2.5     ] \n",
      "\n",
      "before: {'spacing': array([0.78515625, 0.78515625, 1.        ]), 'spacing_transposed': array([1.        , 0.78515625, 0.78515625]), 'data.shape (data is transposed)': (1, 258, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 80, 248, 248)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.703125, 0.703125, 2.5     ]), 'spacing_transposed': array([2.5     , 0.703125, 0.703125]), 'data.shape (data is transposed)': (1, 193, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 150, 222, 222)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (148, 247, 247)\n",
      "class_probabilities.shape (3, 148, 247, 247)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00237.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00232.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 157, 259, 259)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 30, 61], [0, 50, 99], [0, 50, 99]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 175) after crop: (1, 512, 512, 175) spacing: [0.77734399 0.77734399 2.5       ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.77734399, 0.77734399, 2.5       ]), 'spacing_transposed': array([2.5       , 0.77734399, 0.77734399]), 'data.shape (data is transposed)': (1, 175, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 136, 246, 246)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (157, 259, 259)\n",
      "class_probabilities.shape (3, 157, 259, 259)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00250.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00229.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 241, 241)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 40, 81], [0, 40, 81]]\n",
      "number of tiles: 9\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (83, 241, 241)\n",
      "class_probabilities.shape (3, 83, 241, 241)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00252.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00242.nii.gz\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 127, 241, 241)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 31], [0, 40, 81], [0, 40, 81]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "before crop: (1, 512, 512, 210) after crop: (1, 512, 512, 210) spacing: [0.82234335 0.82234335 3.        ] \n",
      "\n",
      "before crop: (1, 512, 512, 51) after crop: (1, 512, 512, 51) spacing: [0.85351562 0.85351562 5.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "before: {'spacing': array([0.85351562, 0.85351562, 5.        ]), 'spacing_transposed': array([5.        , 0.85351562, 0.85351562]), 'data.shape (data is transposed)': (1, 51, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 79, 270, 270)} \n",
      "\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (127, 241, 241)\n",
      "class_probabilities.shape (3, 127, 241, 241)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00247.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00244.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "data shape: (1, 96, 222, 222)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 62], [0, 62]]\n",
      "number of tiles: 4\n",
      "using precomputed Gaussian\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.82234335, 0.82234335, 3.        ]), 'spacing_transposed': array([3.        , 0.82234335, 0.82234335]), 'data.shape (data is transposed)': (1, 210, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 196, 260, 260)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (55, 222, 222)\n",
      "class_probabilities.shape (3, 55, 222, 222)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00246.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00239.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 143, 259, 259)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 47], [0, 50, 99], [0, 50, 99]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "before crop: (1, 512, 512, 284) after crop: (1, 512, 512, 284) spacing: [0.94726562 0.94726562 2.        ] \n",
      "\n",
      "no separate z, order 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (143, 259, 259)\n",
      "class_probabilities.shape (3, 143, 259, 259)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00251.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00238.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 149, 253, 253)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 26, 53], [0, 46, 93], [0, 46, 93]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 45) after crop: (1, 512, 512, 45) spacing: [0.6796875 0.6796875 5.       ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.6796875, 0.6796875, 5.       ]), 'spacing_transposed': array([5.       , 0.6796875, 0.6796875]), 'data.shape (data is transposed)': (1, 45, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 70, 215, 215)} \n",
      "\n",
      "no separate z, order 1\n",
      "before crop: (1, 512, 512, 598) after crop: (1, 512, 512, 598) spacing: [0.7109375 0.7109375 1.       ] \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (149, 253, 253)\n",
      "class_probabilities.shape (3, 149, 253, 253)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00257.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00243.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 143, 276, 276)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 47], [0, 58, 116], [0, 58, 116]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 32) after crop: (1, 512, 512, 32) spacing: [0.64453125 0.64453125 5.        ] \n",
      "\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (203, 259, 259)\n",
      "class_probabilities.shape (3, 203, 259, 259)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00294.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00297.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 158, 234, 234)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 31, 62], [0, 74], [0, 74]]\n",
      "number of tiles: 12\n",
      "using precomputed Gaussian\n",
      "before crop: (1, 512, 512, 624) after crop: (1, 512, 512, 624) spacing: [0.75195312 0.75195312 0.5       ] \n",
      "\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (158, 234, 234)\n",
      "class_probabilities.shape (3, 158, 234, 234)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00298.nii.gz\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00286.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 165, 259, 259)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 34, 69], [0, 50, 99], [0, 50, 99]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "no separate z, order 3\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "no separate z, order 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (165, 259, 259)\n",
      "class_probabilities.shape (3, 165, 259, 259)\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00290.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 106, 264, 264)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 10], [0, 52, 104], [0, 52, 104]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "before crop: (1, 512, 512, 623) after crop: (1, 512, 512, 623) spacing: [0.76757812 0.76757812 0.5       ] \n",
      "\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before crop: (1, 512, 512, 617) after crop: (1, 512, 512, 617) spacing: [0.734375 0.734375 0.5     ] \n",
      "\n",
      "no separate z, order 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (106, 264, 264)\n",
      "class_probabilities.shape (3, 106, 264, 264)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00285.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00292.nii.gz\n",
      "no separate z, order 3\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 148, 281, 281)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 26, 52], [0, 60, 121], [0, 60, 121]]\n",
      "number of tiles: 27\n",
      "using precomputed Gaussian\n",
      "before crop: (1, 512, 512, 41) after crop: (1, 512, 512, 41) spacing: [0.65039062 0.65039062 5.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.65039062, 0.65039062, 5.        ]), 'spacing_transposed': array([5.        , 0.65039062, 0.65039062]), 'data.shape (data is transposed)': (1, 41, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 64, 206, 206)} \n",
      "\n",
      "before: {'spacing': array([0.75195312, 0.75195312, 0.5       ]), 'spacing_transposed': array([0.5       , 0.75195312, 0.75195312]), 'data.shape (data is transposed)': (1, 624, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 97, 238, 238)} \n",
      "\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "no separate z, order 1\n",
      "no separate z, order 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (148, 281, 281)\n",
      "class_probabilities.shape (3, 148, 281, 281)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00288.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00277.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 123, 198, 198)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 27], [0, 38], [0, 38]]\n",
      "number of tiles: 8\n",
      "using precomputed Gaussian\n",
      "prediction done\n",
      "predicted_segmentation.shape (123, 198, 198)\n",
      "class_probabilities.shape (3, 123, 198, 198)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00287.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00280.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 123, 240, 240)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 27], [0, 80], [0, 80]]\n",
      "number of tiles: 8\n",
      "using precomputed Gaussian\n",
      "before crop: (1, 512, 512, 54) after crop: (1, 512, 512, 54) spacing: [0.73632812 0.73632812 3.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.73632812, 0.73632812, 3.        ]), 'spacing_transposed': array([3.        , 0.73632812, 0.73632812]), 'data.shape (data is transposed)': (1, 54, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 50, 233, 233)} \n",
      "\n",
      "before crop: (1, 512, 512, 276) after crop: (1, 512, 512, 276) spacing: [0.83984375 0.83984375 1.        ] \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (123, 240, 240)\n",
      "class_probabilities.shape (3, 123, 240, 240)\n",
      "This worker has ended successfully, no errors to report\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00279.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 170, 170)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 10], [0, 10]]\n",
      "number of tiles: 4\n",
      "using precomputed Gaussian\n",
      "prediction done\n",
      "predicted_segmentation.shape (56, 170, 170)\n",
      "class_probabilities.shape (3, 56, 170, 170)\n",
      "This worker has ended successfully, no errors to report\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00293.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00285.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 206, 206)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 46], [0, 46]]\n",
      "number of tiles: 4\n",
      "using precomputed Gaussian\n",
      "no separate z, order 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (64, 206, 206)\n",
      "class_probabilities.shape (3, 64, 206, 206)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00295.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00299.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 97, 238, 238)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 1], [0, 78], [0, 78]]\n",
      "number of tiles: 8\n",
      "using precomputed Gaussian\n",
      "before: {'spacing': array([0.734375, 0.734375, 0.5     ]), 'spacing_transposed': array([0.5     , 0.734375, 0.734375]), 'data.shape (data is transposed)': (1, 617, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 96, 232, 232)} \n",
      "\n",
      "prediction done\n",
      "predicted_segmentation.shape (97, 238, 238)\n",
      "class_probabilities.shape (3, 97, 238, 238)\n",
      "This worker has ended successfully, no errors to report\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00287.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 233, 233)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 73], [0, 73]]\n",
      "number of tiles: 4\n",
      "using precomputed Gaussian\n",
      "no separate z, order 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (50, 233, 233)\n",
      "class_probabilities.shape (3, 50, 233, 233)\n",
      "This worker has ended successfully, no errors to report\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00298.nii.gz\n",
      "before: {'spacing': array([0.76757812, 0.76757812, 0.5       ]), 'spacing_transposed': array([0.5       , 0.76757812, 0.76757812]), 'data.shape (data is transposed)': (1, 623, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 97, 243, 243)} \n",
      "\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 232, 232)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 72], [0, 72]]\n",
      "number of tiles: 4\n",
      "using precomputed Gaussian\n",
      "prediction done\n",
      "predicted_segmentation.shape (96, 232, 232)\n",
      "class_probabilities.shape (3, 96, 232, 232)\n",
      "This worker has ended successfully, no errors to report\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00294.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 97, 243, 243)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 1], [0, 42, 83], [0, 42, 83]]\n",
      "number of tiles: 18\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.83984375, 0.83984375, 1.        ]), 'spacing_transposed': array([1.        , 0.83984375, 0.83984375]), 'data.shape (data is transposed)': (1, 276, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 86, 265, 265)} \n",
      "\n",
      "before crop: (1, 512, 512, 564) after crop: (1, 512, 512, 564) spacing: [0.91992188 0.91992188 0.5       ] \n",
      "\n",
      "before crop: (1, 512, 512, 591) after crop: (1, 512, 512, 591) spacing: [0.703125 0.703125 0.5     ] \n",
      "\n",
      "no separate z, order 3\n",
      "prediction done\n",
      "predicted_segmentation.shape (97, 243, 243)\n",
      "class_probabilities.shape (3, 97, 243, 243)\n",
      "preprocessing src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00296.nii.gz\n",
      "using preprocessor GenericPreprocessor\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00288.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 265, 265)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 52, 105], [0, 52, 105]]\n",
      "number of tiles: 9\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "no separate z, order 3\n",
      "before crop: (1, 512, 512, 83) after crop: (1, 512, 512, 83) spacing: [0.62109375 0.62109375 5.        ] \n",
      "\n",
      "separate z, order in z is 0 order inplane is 3\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (86, 265, 265)\n",
      "class_probabilities.shape (3, 86, 265, 265)\n",
      "before: {'spacing': array([0.62109375, 0.62109375, 5.        ]), 'spacing_transposed': array([5.        , 0.62109375, 0.62109375]), 'data.shape (data is transposed)': (1, 83, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 129, 196, 196)} \n",
      "\n",
      "This worker has ended successfully, no errors to report\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00296.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 129, 196, 196)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0, 33], [0, 36], [0, 36]]\n",
      "number of tiles: 8\n",
      "using precomputed Gaussian\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "no separate z, order 1\n",
      "prediction done\n",
      "predicted_segmentation.shape (129, 196, 196)\n",
      "class_probabilities.shape (3, 129, 196, 196)\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "no separate z, order 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.91992188, 0.91992188, 0.5       ]), 'spacing_transposed': array([0.5       , 0.91992188, 0.91992188]), 'data.shape (data is transposed)': (1, 564, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 88, 291, 291)} \n",
      "\n",
      "This worker has ended successfully, no errors to report\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00295.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 291, 291)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 66, 131], [0, 66, 131]]\n",
      "number of tiles: 9\n",
      "using precomputed Gaussian\n",
      "prediction done\n",
      "predicted_segmentation.shape (88, 291, 291)\n",
      "class_probabilities.shape (3, 88, 291, 291)\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "before: {'spacing': array([0.703125, 0.703125, 0.5     ]), 'spacing_transposed': array([0.5     , 0.703125, 0.703125]), 'data.shape (data is transposed)': (1, 591, 512, 512)} \n",
      "after:  {'spacing': array([3.22000003, 1.62      , 1.62      ]), 'data.shape (data is resampled)': (1, 92, 222, 222)} \n",
      "\n",
      "This worker has ended successfully, no errors to report\n",
      "predicting src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs/kits_case_00293.nii.gz\n",
      "debug: mirroring True mirror_axes (0, 1, 2)\n",
      "step_size: 0.5\n",
      "do mirror: True\n",
      "data shape: (1, 96, 222, 222)\n",
      "patch size: [ 96 160 160]\n",
      "steps (x, y, and z): [[0], [0, 62], [0, 62]]\n",
      "number of tiles: 4\n",
      "using precomputed Gaussian\n",
      "prediction done\n",
      "predicted_segmentation.shape (92, 222, 222)\n",
      "class_probabilities.shape (3, 92, 222, 222)\n",
      "inference done. Now waiting for the segmentation export to finish...\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: True lowres axis [2]\n",
      "separate z, order in z is 0 order inplane is 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "segmentation_export\n",
      "force_separate_z: None interpolation order: 1\n",
      "separate z: False lowres axis None\n",
      "no separate z, order 1\n",
      "WARNING! Cannot run postprocessing because the postprocessing file is missing. Make sure to run consolidate_folds in the output folder of the model first!\n",
      "The folder you need to run this in is ./src/nnUNetFrame/DATASET/nnUNet_trained_models/nnUNet/3d_fullres/Task001_kits/nnUNetTrainerV2_SGD__nnUNetPlansv2.1\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 生成测试集预测\n",
    "!python eval.py -i src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/imagesTs/ -o src/nnUNetFrame/DATASET/nnUNet_raw/nnUNet_raw_data/Task001_kits/inferTs -t 1 -m 3d_fullres -tr nnUNetTrainerV2_SGD -f all --num_threads_preprocessing=8 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4ac4ac54-4e99-47c4-8f7c-3537b391b36a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 生成测试集预测的脚本 -i 指定输入文件夹 -o 指定输出文件夹\n",
    "!python eval.py -i input_folder -o ouput_folder -t 1 -m 3d_fullres -tr nnUNetTrainerV2_SGD -f all --num_threads_preprocessing=8 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f876f813",
   "metadata": {},
   "outputs": [],
   "source": [
    "!zip -r submit_best.zip *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "99a61795",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:root:Using MoXing-v2.0.0.rc2.4b57a67b-4b57a67b\n",
      "INFO:root:Using OBS-Python-SDK-3.20.9.1\n"
     ]
    }
   ],
   "source": [
    "import moxing as mox\n",
    "data_obs_url = 'obs://bdci2022/nnUNet-submit/submit_best.zip'\n",
    "data_local_url = './submit_best.zip'\n",
    "mox.file.copy_parallel(data_local_url, data_obs_url)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5bbff7c8",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "MindSpore",
   "language": "python",
   "name": "mindspore"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
